package Strings;

public class Test1 {
    public static void main(String[] args) {
        String s="fjgfjg";
        System.out.println(s.contains("f"));
        System.out.println(s.lastIndexOf("f"));
        System.out.println(s.startsWith("f"));
        System.out.println(s.endsWith("g"));
        String f = s.replace("f", "*");
        System.out.println(f);
        System.out.println(s);
        String  s1="I  LOVE YOU";
        String[] s2 = s1.split("  ");
        for (String s3 : s2) {
            System.out.println(s3);
        }

        String  s5="    I   love  china        ";
        String l = s5.substring(s5.indexOf("l"));
        System.out.println(l);
        String substring = s5.substring(s5.indexOf("l"), (s5.indexOf("e") + 1));
        System.out.println(substring);
        String trim = s5.trim();
        System.out.println("|"+trim+"|");
        char[] chars = s5.toCharArray();
        for (char aChar : chars) {
            System.out.println(aChar);
        }
        char[] chars1 = trim.toCharArray();
        for (char c : chars1) {
            System.out.println(c);
        }
        System.out.println("-----------------------------------------");
        byte[] bytes = s5.getBytes();
        for (byte aByte : bytes) {
            System.out.println(aByte);
        }
        double   d=3.14159265358979323584626;
        String s3 = String.valueOf(d);
        System.out.println(s3);
        String   s6="flg";
        String   s7="fll";
        System.out.println(s6.compareTo(s7));


    }
}
